package org.pc2r.protocole.message;

import java.util.List;

import org.pc2r.protocole.EnumRequest;
import org.pc2r.protocole.RequestBuilder;

public class PlayersMessage extends Message {

	final private List<String> players;

	public PlayersMessage(List<String> players) {
		super(EnumRequest.PLAYERS);
		this.players = players;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append(getType());
		builder.append(RequestBuilder.SEPARATOR);
		for (String name : players) {
			builder.append(name).append(RequestBuilder.SEPARATOR);
		}
		builder.append(RequestBuilder.END);
		return builder.toString();
	}

}
